<div id="categories_list">
<h2>Categories</h2>
<ul class="blocklist">
<?php
foreach ($groups as $id => $group){
	echo '<li class="group">'.$group['Group']['title'].'</li>';
	foreach ($categories as $i => $category){
		echo '<ul>';
		if ($category['Category']['group_id'] == $group['Group']['id']){
			echo '<li>'.$this->Html->link($category['Category']['title'], array('controller' => 'categories', 'action' => 'view', $category['Category']['id'])).'</li>';
		}
		echo '</ul>';
	}	
}




?>
</ul>
</div>
